<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			var obj=new Object();
		/*增*/
			obj.name="张三";
			obj.gender="男";
			obj.age=18;
			console.log(obj);             /*浏览器打开才能看*/
			console.log(obj.hello);
		
		/*改*/
			obj.name="李四";
			console.log(obj.name);
			
		/*删*/
			delete obj.name;
			console.log(obj.name);
		/*属性名*/
			var obj1=new Object();
			obj1.name="齐天大圣";
			obj1["123"]="我又来了啊";
			obj1["456"]="谁来了啊";
			var n1="123";
			var n2="456";
			console.log(obj1[n1]);
			console.log(obj1[n2])
		/*属性值*/
			var obj2=new Object();
			obj2.test=obj1;
			console.log(obj2);
			console.log(obj2.test);
			console.log(obj2.test.name);
		/*检查是否有指定的属性*/
			console.log("test" in obj2);
			console.log("abcd" in obj2);
		/*基本数据类型*/
			var a=10;
			var b=a;
			b=20;
			console.log("a:"+a);
			console.log("b:"+b);
		/*引用数据类型（对象）(保存地址)*/
			var obj3=new Object();
			obj3.name="abc";
			var obj4=obj3;
			console.log(obj3);
			console.log(obj4);
			obj4.name="def";
			console.log(obj3);
			console.log(obj4);
			obj4=null;/*设置为空会断开连接，不改变另一个的值*/
			console.log(obj3);
			console.log(obj4);
		/*对象字面量*/
			var obj5={};
			obj5.name="jojo";
			console.log(obj5);
			var obj6={
				name:"yo",
				age:20,
				test:{name:"qwe"}
			};
			console.log(obj6.name);
			console.log(obj6.test);
		/*枚举对象的属性*/
			for(var f in obj5){
				console.log("属性名："+f);
				console.log("属性值："+obj5[f]);
			}
			
		</script>
	</head>
	<body>
	</body>
</html>
